#!/usr/bin/env python
# -*- coding:utf-8 -*-
# @Time    : 2021/5/21 12:38
# @File    : use_dataframe.py
# @Author  : lxy
from pyspark.sql import SparkSession
spark = SparkSession.builder.appName("UserDataFrame").getOrCreate()
spark.sparkContext.setLogLevel("WARNING")
df = spark.read.csv("/master/train.csv",encoding="utf8",header=False,inferSchema=True,sep=",")
df.show()
spark.stop()
